package com.szmengran.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 分页数据信息
 *
 * @Author Joe
 * @Date 2021/10/20 15:38
 * @Version 1.0
 */
@Data
public class PageInfo<T> implements Serializable {

    private static final long serialVersionUID = 1726522342423403L;

    @ApiModelProperty("当前页码")
    private int pageNum;

    @ApiModelProperty("每页大小")
    private int pageSize;

    @ApiModelProperty("总记录数")
    private long total;

    @ApiModelProperty("每页大小")
    private List<T> list;

    public PageInfo(int pageNum, int pageSize, long total) {
        this(pageNum, pageSize, total, null);
    }

    public PageInfo(int pageNum, int pageSize, long total, List<T> list) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
        this.list = list;
    }
}
